<?php
	include_once '../../config.inc.php';
	//print_r($_POST);
	$eve = isset($_POST['eve']) && !empty($_POST['eve']) ? $_POST['eve'] : 0;
	
	//登陆
	if($eve == 1){
		if($_POST['ucode'] != $_SESSION['ucode']){
			//echo '2';
			die('2');
		}
		
		$stmt = $pdo->prepare('select uid,uname from kp_admin where uname=? and upwd=?');
		$stmt->execute(array($_POST['uname'],md5($_POST['upwd'])));
		//$rows = $stmt->rowCount();
		if($arrAdmin = $stmt->fetch(PDO::FETCH_ASSOC)){
			$_SESSION['adminId'] = $arrAdmin['uid'];
			$_SESSION['adminName'] = $arrAdmin['uname'];
			echo '1';
		}else{
			echo '0';
		}
		//print_r($arrAdmin);
		
	}
	
	
?>